import Vue from 'vue'
import 'normalize.css'

import App from './App.vue'
import router from './router'
import store from './store'
import Vant from 'vant'
import "./utils/tiandimap"
// import VueAMap from 'vue-amap';


import 'vant/lib/index.css'

import VueClipboard from 'vue-clipboard2'
import { Lazyload, Dialog } from 'vant'
import { plusReady } from '@/utils/extends'

import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/css/swiper.css'
import global from '@/utils/global'

Vue.prototype.$global = global
Vue.prototype.$imUrl = "https://im.nuanuan.net"
// import touch from 'vue-directive-touch';

// Vue.use(touch);
Vue.use(VueAwesomeSwiper)
Vue.use(Dialog)
Vue.use(Vant)
// Vue.use(VueAMap);
Vue.use(Lazyload, {
  lazyComponent: true
})
Vue.use(VueClipboard)
// VueAMap.initAMapApiLoader({
//   key: '454f3b0d0ab2155ed85e61ffeaf0c1a4',
//   plugin: ["AMap.CircleEditor"],
// });

const imlib = require('@rongcloud/imlib-v4')
const im = imlib.init({ appkey: process.env.VUE_APP_RONG_APPKEY })

Vue.config.productionTip = false

Vue.prototype.$imgUrl = process.env.VUE_APP_QINIU_IMAGE_URL
Vue.prototype.$videoUrl = process.env.VUE_APP_QINIU_VIDEO_URL
Vue.prototype.$store = store
Vue.prototype.$im = im
Vue.prototype.$imlib = imlib
Vue.prototype.$AMapkey = process.env.VUE_APP_AMAP_KEY
Vue.prototype.$plusReady = plusReady

if (localStorage.getItem('state')) {
  store.replaceState(
    Object.assign(
      {},
      store.state,
      JSON.parse(localStorage.getItem('state'))
    )
  )
}
localStorage.removeItem('state')

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
